package pl.edu.pw.elka.wedt.sem10Z.jslt.filesystem;

public class WordCount implements Comparable {
	private int count;
	private String word;
	
	public WordCount() {
		
	}
	public WordCount(String w, int c) {
		this.count = c;
		this.word = w;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public String getWord() {
		return word;
	}
	public void setWord(String word) {
		this.word = word;
	}
	@Override
	public int compareTo(Object arg0) {
		WordCount wc = (WordCount) arg0;
		if(this.count > wc.count) {
			return 1;
		}
		if(this.count == wc.count) {
			return 0;
		}
		if(this.count > wc.count) {
			return -1;
		}
		return 0;
	}
	public String toString() {
		return new StringBuffer(word).append(" : ").append(count).toString();
		
	}
}
